
########### 数值 ##########

## 整数
### 十进制
num1 = 5
### 八进制(python2)
#num2 = 0100
### 八进制(python3)
num2 = 0o12
### 十六进制
num3 = 0x12
### 长整数
num4 = 121212321312312321121212321321121212321312312321


## 浮点数
num5 = 1.2

print(type(num1))
print(type(num2))
print(type(num3))
print(type(num4))
print(type(num5))

# <class 'int'>
# <class 'int'>
# <class 'int'>
# <class 'int'>
# <class 'float'>


print('5/2=',5/2)
print('5/2.0=',5/2.0)
print('5.0/2=',5.0/2)

## 取整
print('5//2=',5//2)
## 取余
print('5%2=',5%2)
## 乘方
print('5**2=',5**2)

# 5/2= 2.5
# 5/2.0= 2.5
# 5.0/2= 2.5
# 5//2= 2
# 5%2= 1
# 5**2= 25




########### 字符串拼接 ###########
print('I am  '+'lixinming')
print('I am  '.__add__('lixinming'))
print('I am  %s, my age is %d'%('lixinming',26))
## 特殊
print('I am  ','lixinming')
print('I am ',1,2)

## 函数
print('how are you'.startswith('how'))
print('how are you'.capitalize())

num = input('please input an integer')
print(type(num))
print(type(int(num)))

# I am  lixinming
# I am  lixinming
# I am  lixinming, my age is 26
# I am   lixinming
# I am  1 2
# True
# How are you
# please input an integer12
# <class 'str'>
# <class 'int'>


###########控制语句##########
a = 1
b = 2
c = None
if a > b:
    print('a > b')
elif a == b:
    print('a ==b ')
else:
    print('a < b')

if c is None:
    print('c is None')
# a < b
# c is None

data = [1,2,3,4]
names = ('zhangsan','lisi')